package com.hanlin.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 描述：work模式的消费者，直接消费的是队列里的消息
 * @author:hl.yuan
 * @date:2021-03-15
 */
@Component
public class WorkCustomer {

    @RabbitListener(queuesToDeclare = @Queue("hlyuan_work"))
    public void receiver(String message){
        System.out.println("work模式的监听一号："+message);
    }

    @RabbitListener(queuesToDeclare = @Queue("hlyuan_work"))
    public void receiver2(String message){
        System.out.println("work模式的监听二号："+message);
    }




}
